<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mdsproject/mds_realdeviceconfig/Mds_RealDeviceConfig.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/mdsproject/mds_realdeviceconfig/Mds_RealDeviceConfig.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        name: "Mds_RealDeviceConfig",
        setup() {
            const table = ref({
                key: "RealDeviceConfigId",
                editTable:true ,
                footer: "Foots",
                cnName: "数据采集设备配置",
                name: "mds_realdeviceconfig/Mds_RealDeviceConfig",
                newTabEdit: false,
                url: "/Mds_RealDeviceConfig/",
                sortName: "RealDeviceConfigId"
            });
            const editFormFields = ref({"RealDeviceId":"","DataProps":"","DataType":"","Readable":"","Writable":"","DbBlock":"","Offset":"","Length":"","WriteAddress":"","Remarks":""});
            const editFormOptions = ref([[{"title":"数采设备ID","field":"RealDeviceId","type":"number"},
                               {"dataKey":"enabled","data":[],"title":"数据属性","field":"DataProps","type":"select"}],
                              [{"dataKey":"enabled","data":[],"title":"数据类型","field":"DataType","type":"select"},
                               {"dataKey":"enabled","data":[],"title":"读属性","field":"Readable","type":"switch"}],
                              [{"dataKey":"enabled","data":[],"title":"写属性","field":"Writable","type":"switch"},
                               {"dataKey":"enabled","data":[],"title":"数据块-PLC","field":"DbBlock","type":"select"}],
                              [{"title":"读取偏移量-字节","field":"Offset","type":"number"},
                               {"title":"读取长度-字节","field":"Length","type":"number"}],
                              [{"title":"写地址","field":"WriteAddress"}],
                              [{"title":"备注","field":"Remarks","colSize":12,"type":"textarea"}]]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:"RealDeviceConfigId",title:"ID",type:"bigint",width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"RealDeviceId",title:"数采设备ID",type:"bigint",width:110,hidden:true,edit:{type:""},showOverflowTooltip:true,align:"left"},
                       {field:"DataProps",title:"数据属性",type:"string",bind:{ key:"enabled",data:[]},width:180,edit:{type:"select"},showOverflowTooltip:true,align:"left"},
                       {field:"DataType",title:"数据类型",type:"int",bind:{ key:"enabled",data:[]},width:110,edit:{type:"select"},showOverflowTooltip:true,align:"left"},
                       {field:"Readable",title:"读属性",type:"int",bind:{ key:"enabled",data:[]},width:110,edit:{type:"switch"},showOverflowTooltip:true,align:"left"},
                       {field:"Writable",title:"写属性",type:"int",bind:{ key:"enabled",data:[]},width:120,edit:{type:"switch"},showOverflowTooltip:true,align:"left"},
                       {field:"DbBlock",title:"数据块-PLC",type:"string",bind:{ key:"enabled",data:[]},width:180,edit:{type:"select"},showOverflowTooltip:true,align:"left"},
                       {field:"Offset",title:"读取偏移量-字节",type:"int",width:110,edit:{type:""},showOverflowTooltip:true,align:"left"},
                       {field:"Length",title:"读取长度-字节",type:"int",width:110,edit:{type:""},showOverflowTooltip:true,align:"left"},
                       {field:"WriteAddress",title:"写地址",type:"string",width:180,edit:{type:""},showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:110,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,edit:{type:"textarea"},showOverflowTooltip:true,align:"left"}]);
            const detail = ref({columns:[]});
            const details = ref([]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
